<script setup lang="ts">
import Child from './components/Child.vue';
import { useCountStore } from './store/count'
import { storeToRefs } from 'pinia'

const store = useCountStore()
const { count, car, dbCount } = storeToRefs(store)

</script>

<template>
  <div>
    App组件 - 数量: {{ count }} ---{{ car }} - 双倍快乐: {{ dbCount }}
    <Child></Child>

    <button @click="store.updateCount(100)">同步改变数量</button>
    <button @click="store.asyncUpdateCount()">异步改变数量</button>
  </div>
</template>

<style scoped></style>
